﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BuySoftwareOnline.Domain.Abstract;
using BuySoftwareOnline.Domain;


namespace BuySoftwareOnline.Web.Controllers
{
    public class VerticalController : Controller
    {
        //
        // GET: /Vertical/
        private ICategoryRepository repository;

        public VerticalController(ICategoryRepository repo)
        {
            repository = repo;
        }

        public PartialViewResult Menu(string category = null)
        {
            ViewBag.SelectedCategory = category;
            IEnumerable<string> categories = repository.Categories.Select(x => x.CategoryName).Distinct();
            string a = HttpContext.Request.ApplicationPath;
            ViewBag.Root = a;
            return PartialView(categories);
        }

        public ActionResult Index()
        {
            return View();
        }

    }
}
